package com.sax.sax.service;

import java.io.File;
import java.util.List;

import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;

import com.sax.sax.entity.Record;
import com.sax.sax.handler.RecordHandler;

public class SAXRecordService {

	public List<Record> getSAXRecord(File f) throws Exception{
		SAXParserFactory spf=SAXParserFactory.newInstance();
		SAXParser parser=spf.newSAXParser();
		RecordHandler handler=new RecordHandler();
		parser.parse(f, handler);
		return handler.getRecordList();
	}
}
